<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class OpenSSL::PKey::EC::Group - openssl: Ruby Standard Library Documentation</title>


<script src="../../../js/navigation.js" defer></script>
<script src="../../../js/search.js" defer></script>
<script src="../../../js/search_index.js" defer></script>
<script src="../../../js/searcher.js" defer></script>
<script src="../../../js/darkfish.js" defer></script>

<script src="../../../js/jquery-3.2.0.min.js"></script>

<script src="../../../js/vue.min.js"></script>
<script src="../../../js/js.cookie.min.js"></script>

<link href="../../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../../css/rdoc.css" rel="stylesheet">
<link href="../../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../../";
  var index_rel_prefix = "../../../";
  var darkModeCsseHref = "../../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../../table_of_contents.html#pages">Pages</a>
    <a href="../../../table_of_contents.html#classes">Classes</a>
    <a href="../../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3D-3D">#==</a>
    <li ><a href="#method-i-asn1_flag">#asn1_flag</a>
    <li ><a href="#method-i-asn1_flag-3D">#asn1_flag=</a>
    <li ><a href="#method-i-cofactor">#cofactor</a>
    <li ><a href="#method-i-curve_name">#curve_name</a>
    <li ><a href="#method-i-degree">#degree</a>
    <li ><a href="#method-i-eql-3F">#eql?</a>
    <li ><a href="#method-i-generator">#generator</a>
    <li ><a href="#method-i-initialize_copy">#initialize_copy</a>
    <li ><a href="#method-i-order">#order</a>
    <li ><a href="#method-i-point_conversion_form">#point_conversion_form</a>
    <li ><a href="#method-i-point_conversion_form-3D">#point_conversion_form=</a>
    <li ><a href="#method-i-seed">#seed</a>
    <li ><a href="#method-i-seed-3D">#seed=</a>
    <li ><a href="#method-i-set_generator">#set_generator</a>
    <li ><a href="#method-i-to_der">#to_der</a>
    <li ><a href="#method-i-to_pem">#to_pem</a>
    <li ><a href="#method-i-to_text">#to_text</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-OpenSSL::PKey::EC::Group">
    <h1 id="class-OpenSSL::PKey::EC::Group" class="class">
      class OpenSSL::PKey::EC::Group
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          OpenSSL::PKey::EC::Group.new(ec_group)
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          OpenSSL::PKey::EC::Group.new(pem_or_der_encoded)
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          OpenSSL::PKey::EC::Group.new(:GFp, bignum_p, bignum_a, bignum_b)
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          OpenSSL::PKey::EC::Group.new(:GF2m, bignum_p, bignum_a, bignum_b)
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="Group.html"><code>EC::Group</code></a> object.</p>

<p>If the first argument is :GFp or :GF2m, creates a new curve with given parameters.</p>

                              <div class="method-source-code" id="new-source">
            <pre>static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
{
    VALUE arg1, arg2, arg3, arg4;
    EC_GROUP *group;

    TypedData_Get_Struct(self, EC_GROUP, &amp;ossl_ec_group_type, group);
    if (group)
        ossl_raise(rb_eRuntimeError, &quot;EC_GROUP is already initialized&quot;);

    switch (rb_scan_args(argc, argv, &quot;13&quot;, &amp;arg1, &amp;arg2, &amp;arg3, &amp;arg4)) {
    case 1:
        if (rb_obj_is_kind_of(arg1, cEC_GROUP)) {
            const EC_GROUP *arg1_group;

            GetECGroup(arg1, arg1_group);
            if ((group = EC_GROUP_dup(arg1_group)) == NULL)
                ossl_raise(eEC_GROUP, &quot;EC_GROUP_dup&quot;);
        } else {
            BIO *in = ossl_obj2bio(&amp;arg1);

            group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
            if (!group) {
                OSSL_BIO_reset(in);
                group = d2i_ECPKParameters_bio(in, NULL);
            }

            BIO_free(in);

            if (!group) {
                const char *name = StringValueCStr(arg1);
                int nid = OBJ_sn2nid(name);

                ossl_clear_error(); /* ignore errors in d2i_ECPKParameters_bio() */
                if (nid == NID_undef)
                    ossl_raise(eEC_GROUP, &quot;unknown curve name (%&quot;PRIsVALUE&quot;)&quot;, arg1);

                group = EC_GROUP_new_by_curve_name(nid);
                if (group == NULL)
                    ossl_raise(eEC_GROUP, &quot;unable to create curve (%&quot;PRIsVALUE&quot;)&quot;, arg1);

                EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
                EC_GROUP_set_point_conversion_form(group, POINT_CONVERSION_UNCOMPRESSED);
            }
        }

        break;
    case 4:
        if (SYMBOL_P(arg1)) {
            ID id = SYM2ID(arg1);
            EC_GROUP *(*new_curve)(const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *) = NULL;
            const BIGNUM *p = GetBNPtr(arg2);
            const BIGNUM *a = GetBNPtr(arg3);
            const BIGNUM *b = GetBNPtr(arg4);

            if (id == s_GFp) {
                new_curve = EC_GROUP_new_curve_GFp;
#if !defined(OPENSSL_NO_EC2M)
            } else if (id == s_GF2m) {
                new_curve = EC_GROUP_new_curve_GF2m;
#endif
            } else {
                ossl_raise(rb_eArgError, &quot;unknown symbol, must be :GFp or :GF2m&quot;);
            }

            if ((group = new_curve(p, a, b, ossl_bn_ctx)) == NULL)
                ossl_raise(eEC_GROUP, &quot;EC_GROUP_new_by_GF*&quot;);
        } else {
             ossl_raise(rb_eArgError, &quot;unknown argument, must be :GFp or :GF2m&quot;);
        }

        break;
    default:
        ossl_raise(rb_eArgError, &quot;wrong number of arguments&quot;);
    }

    ASSUME(group);
    RTYPEDDATA_DATA(self) = group;

    return self;
}</pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3D-3D" class="method-detail method-alias">
                      <div class="method-heading">
                        <span class="method-callseq">
                          group1 == group2   &rarr; true | false
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Returns <code>true</code> if the two groups use the same curve and have the same parameters, <code>false</code> otherwise.</p>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Group.html#method-i-eql-3F">eql?</a>
                            </div>
                          </div>

                  <div id="method-i-asn1_flag" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          asn1_flag &rarr; Integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the flags set on the group.</p>

<p>See also <a href="Group.html#method-i-asn1_flag-3D"><code>asn1_flag=</code></a>.</p>

                              <div class="method-source-code" id="asn1_flag-source">
            <pre>static VALUE ossl_ec_group_get_asn1_flag(VALUE self)
{
    EC_GROUP *group = NULL;
    int flag;

    GetECGroup(self, group);
    flag = EC_GROUP_get_asn1_flag(group);

    return INT2NUM(flag);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-asn1_flag-3D" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          asn1_flag = flags
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets flags on the group. The flag value is used to determine how to encode the group: encode explicit parameters or named curve using an OID.</p>

<p>The flag value can be either of:</p>
<ul><li>
<p>EC::NAMED_CURVE</p>
</li><li>
<p>EC::EXPLICIT_CURVE</p>
</li></ul>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_set_asn1_flag().</p>

                              <div class="method-source-code" id="asn1_flag-3D-source">
            <pre>static VALUE ossl_ec_group_set_asn1_flag(VALUE self, VALUE flag_v)
{
    EC_GROUP *group = NULL;

    GetECGroup(self, group);
    EC_GROUP_set_asn1_flag(group, NUM2INT(flag_v));

    return flag_v;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cofactor" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          get_cofactor   &rarr; cofactor_bn
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the cofactor of the group.</p>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get_cofactor()</p>

                              <div class="method-source-code" id="cofactor-source">
            <pre>static VALUE ossl_ec_group_get_cofactor(VALUE self)
{
    VALUE bn_obj;
    BIGNUM *bn;
    EC_GROUP *group = NULL;

    GetECGroup(self, group);

    bn_obj = ossl_bn_new(NULL);
    bn = GetBNPtr(bn_obj);

    if (EC_GROUP_get_cofactor(group, bn, ossl_bn_ctx) != 1)
        ossl_raise(eEC_GROUP, &quot;EC_GROUP_get_cofactor&quot;);

    return bn_obj;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-curve_name" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          curve_name  &rarr; String
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the curve name (sn).</p>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get_curve_name()</p>

                              <div class="method-source-code" id="curve_name-source">
            <pre>static VALUE ossl_ec_group_get_curve_name(VALUE self)
{
    EC_GROUP *group = NULL;
    int nid;

    GetECGroup(self, group);
    if (group == NULL)
        return Qnil;

    nid = EC_GROUP_get_curve_name(group);

/* BUG: an nid or asn1 object should be returned, maybe. */
    return rb_str_new2(OBJ_nid2sn(nid));
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-degree" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          degree   &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get_degree()</p>

                              <div class="method-source-code" id="degree-source">
            <pre>static VALUE ossl_ec_group_get_degree(VALUE self)
{
    EC_GROUP *group = NULL;

    GetECGroup(self, group);

    return INT2NUM(EC_GROUP_get_degree(group));
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-eql-3F" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          eql?(group2)   &rarr; true | false
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns <code>true</code> if the two groups use the same curve and have the same parameters, <code>false</code> otherwise.</p>

                              <div class="method-source-code" id="eql-3F-source">
            <pre>static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
{
    EC_GROUP *group1 = NULL, *group2 = NULL;

    GetECGroup(a, group1);
    GetECGroup(b, group2);

    switch (EC_GROUP_cmp(group1, group2, ossl_bn_ctx)) {
    case 0: return Qtrue;
    case 1: return Qfalse;
    default: ossl_raise(eEC_GROUP, &quot;EC_GROUP_cmp&quot;);
    }
}</pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Group.html#method-i-3D-3D">==</a>
                            </div>

                          </div>

                  <div id="method-i-generator" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          generator   &rarr; ec_point
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the generator of the group.</p>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get0_generator()</p>

                              <div class="method-source-code" id="generator-source">
            <pre>static VALUE ossl_ec_group_get_generator(VALUE self)
{
    EC_GROUP *group;
    const EC_POINT *generator;

    GetECGroup(self, group);
    generator = EC_GROUP_get0_generator(group);
    if (!generator)
        return Qnil;

    return ec_point_new(generator, group);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initialize_copy" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initialize_copy</span><span
                                class="method-args">(p1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initialize_copy-source">
            <pre>static VALUE
ossl_ec_group_initialize_copy(VALUE self, VALUE other)
{
    EC_GROUP *group, *group_new;

    TypedData_Get_Struct(self, EC_GROUP, &amp;ossl_ec_group_type, group_new);
    if (group_new)
        ossl_raise(eEC_GROUP, &quot;EC::Group already initialized&quot;);
    GetECGroup(other, group);

    group_new = EC_GROUP_dup(group);
    if (!group_new)
        ossl_raise(eEC_GROUP, &quot;EC_GROUP_dup&quot;);
    RTYPEDDATA_DATA(self) = group_new;

    return self;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-order" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          get_order   &rarr; order_bn
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the order of the group.</p>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get_order()</p>

                              <div class="method-source-code" id="order-source">
            <pre>static VALUE ossl_ec_group_get_order(VALUE self)
{
    VALUE bn_obj;
    BIGNUM *bn;
    EC_GROUP *group = NULL;

    GetECGroup(self, group);

    bn_obj = ossl_bn_new(NULL);
    bn = GetBNPtr(bn_obj);

    if (EC_GROUP_get_order(group, bn, ossl_bn_ctx) != 1)
        ossl_raise(eEC_GROUP, &quot;EC_GROUP_get_order&quot;);

    return bn_obj;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-point_conversion_form" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          point_conversion_form &rarr; Symbol
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the form how <a href="Point.html"><code>EC::Point</code></a> data is encoded as ASN.1.</p>

<p>See also <a href="Group.html#method-i-point_conversion_form-3D"><code>point_conversion_form=</code></a>.</p>

                              <div class="method-source-code" id="point_conversion_form-source">
            <pre>static VALUE ossl_ec_group_get_point_conversion_form(VALUE self)
{
    EC_GROUP *group = NULL;
    point_conversion_form_t form;
    VALUE ret;

    GetECGroup(self, group);
    form = EC_GROUP_get_point_conversion_form(group);

    switch (form) {
    case POINT_CONVERSION_UNCOMPRESSED: ret = ID_uncompressed; break;
    case POINT_CONVERSION_COMPRESSED:   ret = ID_compressed; break;
    case POINT_CONVERSION_HYBRID:       ret = ID_hybrid; break;
    default:    ossl_raise(eEC_GROUP, &quot;unsupported point conversion form: %d, this module should be updated&quot;, form);
    }

   return ID2SYM(ret);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-point_conversion_form-3D" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          point_conversion_form = form
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the form how <a href="Point.html"><code>EC::Point</code></a> data is encoded as ASN.1 as defined in X9.62.</p>

<p><em>format</em> can be one of these:</p>
<dl class="rdoc-list note-list"><dt><code>:compressed</code>
<dd>
<p>Encoded as z||x, where z is an octet indicating which solution of the equation y is. z will be 0x02 or 0x03.</p>
</dd><dt><code>:uncompressed</code>
<dd>
<p>Encoded as z||x||y, where z is an octet 0x04.</p>
</dd><dt><code>:hybrid</code>
<dd>
<p>Encodes as z||x||y, where z is an octet indicating which solution of the equation y is. z will be 0x06 or 0x07.</p>
</dd></dl>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_set_point_conversion_form()</p>

                              <div class="method-source-code" id="point_conversion_form-3D-source">
            <pre>static VALUE
ossl_ec_group_set_point_conversion_form(VALUE self, VALUE form_v)
{
    EC_GROUP *group;
    point_conversion_form_t form;

    GetECGroup(self, group);
    form = parse_point_conversion_form_symbol(form_v);

    EC_GROUP_set_point_conversion_form(group, form);

    return form_v;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-seed" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          seed   &rarr; String or nil
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_get0_seed()</p>

                              <div class="method-source-code" id="seed-source">
            <pre>static VALUE ossl_ec_group_get_seed(VALUE self)
{
    EC_GROUP *group = NULL;
    size_t seed_len;

    GetECGroup(self, group);
    seed_len = EC_GROUP_get_seed_len(group);

    if (seed_len == 0)
        return Qnil;

    return rb_str_new((const char *)EC_GROUP_get0_seed(group), seed_len);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-seed-3D" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          seed = seed  &rarr; seed
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_set_seed()</p>

                              <div class="method-source-code" id="seed-3D-source">
            <pre>static VALUE ossl_ec_group_set_seed(VALUE self, VALUE seed)
{
    EC_GROUP *group = NULL;

    GetECGroup(self, group);
    StringValue(seed);

    if (EC_GROUP_set_seed(group, (unsigned char *)RSTRING_PTR(seed), RSTRING_LEN(seed)) != (size_t)RSTRING_LEN(seed))
        ossl_raise(eEC_GROUP, &quot;EC_GROUP_set_seed&quot;);

    return seed;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_generator" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          set_generator(generator, order, cofactor)   &rarr; self
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the curve parameters. <em>generator</em> must be an instance of <a href="Point.html"><code>EC::Point</code></a> that is on the curve. <em>order</em> and <em>cofactor</em> are integers.</p>

<p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for EC_GROUP_set_generator()</p>

                              <div class="method-source-code" id="set_generator-source">
            <pre>static VALUE ossl_ec_group_set_generator(VALUE self, VALUE generator, VALUE order, VALUE cofactor)
{
    EC_GROUP *group = NULL;
    const EC_POINT *point;
    const BIGNUM *o, *co;

    GetECGroup(self, group);
    GetECPoint(generator, point);
    o = GetBNPtr(order);
    co = GetBNPtr(cofactor);

    if (EC_GROUP_set_generator(group, point, o, co) != 1)
        ossl_raise(eEC_GROUP, &quot;EC_GROUP_set_generator&quot;);

    return self;
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_der" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          to_der   &rarr; String
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for i2d_ECPKParameters_bio()</p>

                              <div class="method-source-code" id="to_der-source">
            <pre>static VALUE ossl_ec_group_to_der(VALUE self)
{
    return ossl_ec_group_to_string(self, EXPORT_DER);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_pem" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          to_pem   &rarr; String
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for PEM_write_bio_ECPKParameters()</p>

                              <div class="method-source-code" id="to_pem-source">
            <pre>static VALUE ossl_ec_group_to_pem(VALUE self)
{
    return ossl_ec_group_to_string(self, EXPORT_PEM);
}</pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_text" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          to_text   &rarr; String
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>See the <a href="../../../OpenSSL.html"><code>OpenSSL</code></a> documentation for ECPKParameters_print()</p>

                              <div class="method-source-code" id="to_text-source">
            <pre>static VALUE ossl_ec_group_to_text(VALUE self)
{
    EC_GROUP *group;
    BIO *out;
    VALUE str;

    GetECGroup(self, group);
    if (!(out = BIO_new(BIO_s_mem()))) {
        ossl_raise(eEC_GROUP, &quot;BIO_new(BIO_s_mem())&quot;);
    }
    if (!ECPKParameters_print(out, group, 0)) {
        BIO_free(out);
        ossl_raise(eEC_GROUP, NULL);
    }
    str = ossl_membio2str(out);

    return str;
}</pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

